package com.ruoyi.controller;

import com.ruoyi.common.Result;
import com.ruoyi.common.ResultObject;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.service.IMerchantUserService;
import com.ruoyi.userlogin.dto.UserEntityDTO;

import com.ruoyi.userlogin.pojo.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

/**
 * 商家和专家注册后需要运营商审核 springscurity+jwt完成商家和专家商登录Controller
 * 
 * @author ruoyi
 * @date 2023-02-24
 */
@RestController
@RequestMapping("/user")
@RefreshScope

public class MerchantUserController extends BaseController
{
    @Autowired
    private IMerchantUserService merchantUserService;





    /**
     * 查询未审核的列表
     */
    @GetMapping("/findlist")
    public ResultObject<UserEntity> findlist() {
        /**
         * 调用业务层
         */
        return merchantUserService.findlist();
    }

    /**
     * 商家和专家注册后需要运营商审核
     */
    @RequestMapping("/.")
    public Result upadtastutas(@RequestBody UserEntityDTO userEntityDTO){
        /**
         * 调用业务层
         */
        return merchantUserService.upadtastutas(userEntityDTO);
    }


    /**
     * 登录方法
     */
    @RequestMapping("login")
    public ResultObject<Map> login(@RequestBody UserEntityDTO userEntityDTO){
        /**
         * 调用业务层
         */
        return merchantUserService.login(userEntityDTO);
    }



}
